package com.lyh.mp.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.Date;

/**
 * @author linyehui
 * @date 2023/6/16
 */
@Data
public class User {
    @TableId(type = IdType.ASSIGN_ID)//MyBatis-Plus默认的主键策略雪花算法
    //@TableId(type = IdType.AUTO)//主键自增
    private Long id;
    private String name;
    private Integer age;
    private String email;

    @TableField(fill = FieldFill.INSERT)    //自动填充注解
    private Date createTime;  //create_time

    @TableField(fill = FieldFill.INSERT_UPDATE)     //自动填充注解
    private Date updateTime; //update_time

    @Version//乐观锁
    @TableField(fill = FieldFill.INSERT)    //自动填充注解
    private Integer version;//乐观锁版本号

    @TableLogic//逻辑删除
    private Integer deleted;

}
